﻿using MovingChameLibrary.Models;
using MovingChameLibrary.Models.MenuPage;
using MovingChameLibrary.ScheduleServiceReference;
using MovingChameLibrary.TourServiceReference;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MovingChameLibrary.ServiceManager
{
    public static class DataConverter
    {
        public static Tour ConvertToTour(TourData tourData, TourGroup tourGroup = null, int rowSpan = 3, int colSpan = 3)
        {
            Tour tour = new Tour(tourData.Id, tourData.Name, tourData.Summary, tourData.ImageStream, tourData.Description,
                tourData.Budget, tourData.Type, tourData.Length, null, tourGroup);
            tour.RowSpan = rowSpan;
            tour.ColSpan = colSpan;
            return tour;
        }

        public static Schedule ConvertToSchedule(ScheduleData scheduleData, Tour tour)
        {
            Schedule schedule = new Schedule(scheduleData.Id, scheduleData.LocationName, scheduleData.LocationName, scheduleData.ImageStream,
                scheduleData.LocationLatitude, scheduleData.LocationLongitude,
                scheduleData.StartTime, scheduleData.EndTime, scheduleData.DateOrder, tour);
            return schedule;
        }
    }
}